package com.guigu.guliorder.entity.dto;


import com.guigu.gulicommon.api.PageQueryParameters;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;

import static com.guigu.gulicommon.constant.CheckParametersConstant.*;

/**
 * 查询订单项分页入参
 *
 * @author 陈俊杰
 * @version 1.0
 * @since 2024/8/16 23:34
 */

@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
@Data
public class SelectOrderItemPagesDto implements PageQueryParameters {

    /**
     * 查询参数
     */
    private String queryParam;

    /**
     * 页码
     */
    @NotNull(message = PAGE_NUM_CANNOT_BE_NULL)
    @Range(min = PAGE_NUM_MIN_VALUE, max = PAGE_NUM_MAX_VALUE, message = PAGE_NUM_OUT_OF_BOUNDS)
    private Long pageNum;
    /**
     * 分页大小
     */
    @NotNull(message = PAGE_SIZE_CANNOT_BE_NULL)
    @Range(min = PAGE_SIZE_MIN_VALUE, max = PAGE_SIZE_MAX_VALUE, message = PAGE_SIZE_OUT_OF_BOUNDS)
    private Long pageSize;

    @Override
    public void setPageNum(Long pageNum) {
        this.pageNum = pageNum;
    }

    @Override
    public void setPageSize(Long pageSize) {
        this.pageSize = pageSize;
    }
}
